home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / C / BTRVEX.ZIP / BTRVDEFS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-04-24  |  6.7 KB  |  263 lines

  1. #define B_OPEN        0
  2. #define B_CLOSE       1
  3. #define B_INSERT      2
  4. #define B_ADD         2
  5. #define B_UPDATE      3
  6. #define B_DELETE      4
  7. #define B_EQ          5
  8. #define B_NEXT        6
  9. #define B_PREV        7
  10. #define B_GT          8
  11. #define B_GE          9
  12. #define B_LT         10
  13. #define B_LE         11
  14. #define B_LOW        12
  15. #define B_HIGH       13
  16. #define B_CREATE     14
  17. #define B_STAT       15
  18. #define B_EXTEND     16
  19. #define B_SETDIR     17
  20. #define B_GETDIR     18
  21. #define B_BEGTRANS   19
  22. #define B_ENDTRANS   20
  23. #define B_ABORTTRANS 21
  24. #define B_GETPOS     22
  25. #define B_GETDIRECT  23
  26. #define B_STEP       24
  27. #define B_STOP       25
  28. #define B_VERSION    26
  29. #define B_UNLOCK     27
  30. #define B_RESET      28
  31. #define B_SETOWNER   29
  32. #define B_CLEAROWNER 30
  33. #define B_EQ_KEY     55
  34. #define B_NEXT_KEY   56
  35. #define B_PREV_KEY   57
  36. #define B_GT_KEY     58
  37. #define B_GE_KEY     59
  38. #define B_LT_KEY     60
  39. #define B_LE_KEY     61
  40. #define B_LOW_KEY    62
  41. #define B_HIGH_KEY   63
  42. #define B_LOCK_WAIT   100
  43. #define B_LOCK_NOWAIT 200
  44.  
  45. #define b_open       B_OPEN
  46. #define b_close      B_CLOSE
  47. #define b_insert     B_INSERT
  48. #define b_update     B_UPDATE
  49. #define b_delete     B_DELETE
  50. #define b_eq         B_EQ
  51. #define b_next       B_NEXT
  52. #define b_prev       B_PREV
  53. #define b_gt         B_GT
  54. #define b_ge         B_GE
  55. #define b_lt         B_LT
  56. #define b_le         B_LE
  57. #define b_low        B_LOW
  58. #define b_high       B_HIGH
  59. #define b_create     B_CREATE
  60. #define b_stat       B_STAT
  61. #define b_extend     B_EXTEND
  62. #define b_setdir     B_SETDIR
  63. #define b_getdir     B_GETDIR
  64. #define b_begtrans   B_BEGTRANS
  65. #define b_endtrans   B_ENDTRANS
  66. #define b_aborttrans B_ABORTTRANS
  67. #define b_getpos     B_GETPOS
  68. #define b_getdirect  B_GETDIRECT
  69. #define b_step       B_STEP
  70. #define b_stop       B_STOP
  71. #define b_version    B_VERSION
  72. #define b_unlock     B_UNLOCK
  73. #define b_reset      B_RESET
  74. #define b_setowner   B_SETOWNER
  75. #define b_clearowner B_CLEAROWNER
  76. #define b_eq_key     B_EQ_KEY
  77. #define b_next_key   B_NEXT_KEY
  78. #define b_prev_key   B_PREV_KEY
  79. #define b_gt_key     B_GT_KEY
  80. #define b_ge_key     B_GE_KEY
  81. #define b_lt_key     B_LT_KEY
  82. #define b_le_key     B_LE_KEY
  83. #define b_low_key    B_LOW_KEY
  84. #define b_high_key   B_HIGH_KEY
  85.  
  86. /* Key Flag Definitions */
  87. #define DUPLICATE      1
  88. #define MODIFIABLE     2
  89. #define BINARY         4
  90. #define NULL_VALUE     8
  91. #define SEGMENTED     16
  92. #define ALT_COL_SEQ   32
  93. #define DESCENDING    64
  94. #define SUPPLEMENTAL 128
  95. #define EXTENDED     256
  96. #define CHECK_FLAGS   11  /* DUPLICATE | MODIFIABLE | NULL_VALUE */
  97.  
  98. /* Extended Key Types */
  99. #define B_STRING         0
  100. #define B_INTEGER        1
  101. #define B_FLOAT          2
  102. #define B_DATE           3
  103. #define B_TIME           4
  104. #define B_DECIMAL        5
  105. #define B_MONEY          6
  106. #define B_LOGICAL        7
  107. #define B_NUMERIC        8
  108. #define B_BFLOAT         9
  109. #define B_LSTRING       10
  110. #define B_ZSTRING       11
  111. #define B_UNS_BINARY    14
  112.  
  113. /* OPEN MODES */
  114. #define B_NORMAL        0
  115. #define B_ACCELERATED  -1
  116. #define B_READONLY     -2
  117. #define B_VERIFY       -3
  118.  
  119.  
  120. /* Used in STATBUF for File Flags */
  121. #define VAR_LEN        1
  122. #define BLANK_COMP     2
  123. #define PREALLOCATE    4
  124.  
  125. #define ERR_INVALOP       1
  126. #define ERR_IO            2
  127. #define ERR_NOOPEN        3
  128. #define ERR_KEYNOTFOUND   4
  129. #define ERR_DUPLICATE     5
  130. #define ERR_INVALKEYNUM   6
  131. #define ERR_DIFFKEYNUM    7
  132. #define ERR_INVALPOSITION 8
  133. #define ERR_EOF           9
  134. #define ERR_MODIFIABLE    10
  135. #define ERR_INVALFILENAME 11
  136. #define ERR_FILENOTFOUND  12
  137. #define ERR_EXTENSION     13
  138. #define ERR_PREOPEN       14
  139. #define ERR_PREIMAGE      15
  140. #define ERR_EXPANSION     16
  141. #define ERR_CLOSE         17
  142. #define ERR_DISKFULL      18
  143. #define ERR_UNRECOVERABLE 19
  144. #define ERR_NORECMANAGER  20
  145. #define ERR_KEYBUFLEN     21
  146. #define ERR_RECBUFLEN     22
  147. #define ERR_POSBLOCK      23
  148. #define ERR_PAGESIZE      24
  149. #define ERR_CREATEIO      25
  150. #define ERR_NUMKEYS       26
  151. #define ERR_KEYPOS        27
  152. #define ERR_RECLEN        28
  153. #define ERR_KEYLEN        29
  154. #define ERR_NOTBTRFILE    30
  155. #define ERR_EXTEND        31
  156. #define ERR_EXTENDIO      32
  157. #define ERR_EXTENDNAME    34
  158. #define ERR_DIRECTORY     35
  159. #define ERR_TRANSACTION   36
  160. #define ERR_BEGTRANS      37
  161. #define ERR_TRANSCONTROL  38
  162. #define ERR_ENDABORT      39
  163. #define ERR_TRANSACTMAX   40
  164. #define ERR_TRANSOPENCLOS 41
  165. #define ERR_ACCELACCESS   42
  166. #define ERR_INVALRECADD   43
  167. #define ERR_NULLKEYPATH   44
  168. #define ERR_KEYFLAGS      45
  169. #define ERR_ACCESSDENIED  46
  170. #define ERR_MAXOPENFILES  47
  171. #define ERR_ALTCOLSEQ     48
  172. #define ERR_KEYTYPE       49
  173. #define ERR_OWNERSET      50
  174. #define ERR_INVALIDOWNER  51
  175. #define ERR_WRITINGCAHCE  52
  176. #define ERR_INVINTERFACE  53
  177. #define ERR_CONFLICT      80
  178. #define ERR_LOCKFULL      81
  179. #define ERR_LOSTPOSITION  82
  180. #define ERR_OUTSIDETRANS  83
  181. #define ERR_RECORDINUSE   84
  182. #define ERR_FILEINUSE     85
  183. #define ERR_FILEFULL      86
  184. #define ERR_HANDLEFULL    87
  185. #define ERR_MODE          88
  186. #define ERR_NAME          89
  187. #define ERR_DEVICEFULL    90
  188. #define ERR_SERVER        91
  189. #define ERR_TRANSFULL     92
  190. #define ERR_DEMO24        99
  191.  
  192. #define TRUE      1
  193. #define FALSE     0
  194. #define ALL_FILES NULL
  195.  
  196. #define NUM_RECS  1
  197. #define REC_LEN   2
  198. #define PG_SIZE   3
  199. #define INDEXES   4
  200. #define FLAGS     5
  201. #define ALL       6
  202.  
  203. typedef struct {
  204.    int  key_pos;
  205.    int  key_len;
  206.    int  key_flags;
  207.    long num_keys;
  208.    unsigned char ext_key_type;
  209.    unsigned char null_value;
  210.    char reserved[4];
  211. } BTRSEGMENT;
  212.  
  213. typedef struct
  214.    {
  215.    int reclen;
  216.    int pgsize;
  217.    int numind;
  218.    long numrecs;
  219.    int fileflags;
  220.    char res[4];
  221.    BTRSEGMENT segment[24];
  222.    char altcolseq[265];
  223.    int buf_len;
  224. } STATBUF;
  225.  
  226. typedef struct {
  227.    int  btr_major;
  228.    int  btr_minor;
  229.    char net;
  230.    int  lib_major;
  231.    int  lib_minor;
  232. } BTR_VERSION;
  233.  
  234. typedef struct {
  235.    int errnum;
  236.    char descrip[40];
  237.    } ERROR_MSG;
  238.  
  239. /*  Function Prototypes  */
  240. int  BADD(char *,void *);
  241. int  BCHANGEINDEX(char *,int);
  242. int  BCLEAROWNER(char *filename);
  243. int  BCLOSE(char *);
  244. int  BCREATE(char *, STATBUF *);
  245. int  BDELETE(char *);
  246. int  BFILEINFO(char *,int,void *);
  247. int  BGET(int,char *,int,void *,void *);
  248. int  BGETDIRECT(char *,void *,void *);
  249. int  BGETDIRECTORY(int drive,char *path);
  250. int  BGETPOSITION(char *,void *);
  251. int  BSETOWNER(char *filename, char *owner,int access);
  252. int  BSTART(void);
  253. int  BSETDIRECTORY(char *path);
  254. void BTR_ERROR(int, char *);
  255. int  BTRANS(int);
  256. int  BTRV(int,char *,void *,int *,char *,int);
  257. int  BUNLOCK(char *);
  258. int  BUPDATE(char *,void *);
  259. int  BXTR(int,char *,int,char *,char *);
  260. int  BZAP(char *);
  261. int  GET_FILE_NUM(char *);
  262. int  GET_ERR_MSG(int);
  263.